package DBWrapper;

# $Id: DBWrapper.pm 213 2010-07-12 18:56:23Z dolbanavt $
# $Date: 2010-07-12 21:56:34 +0300 (Пнд, 12 Июл 2010) $
# $HeadURL: https://robosearch.googlecode.com/svn/branches/reborn/lib/DBWrapper.pm $
# $LastChangedRevision: 348 $

use parent qw( JIP::BaseClass Class::Accessor::Fast );
use JIP::ToolSet;
use Carp qw( croak );
use English qw( -no_match_vars );
use JIP::Utils qw( check_named_params );

our $VERSION = '1.0';

__PACKAGE__->follow_best_practice;

__PACKAGE__->mk_accessors( qw( dbh ) );

sub _init {
    my ( $self, $params_ref ) = @ARG;

    check_named_params(
        rules_ref  => { dbh => { required => 1, defined  => 1 } },
        params_ref => $params_ref,
    );

    $self->set_dbh( $params_ref->{'dbh'} );

    return $self;
}

1;

__END__

=head1 NAME

DBWrapper - базовый класс обертки над базой данных

=head1 SYNOPSIS

    use DBWrapper;

    my $w = DBWrapper->new(
        dbh => DBI->new(),
    );

    $w->get_dbh->do();

=head1 DEPENDENCIES

Class::Accessor::Fast (from CPAN)

JIP::ToolSet (from base_lib)

JIP::BaseClass (from base_lib)

JIP::Utils (from base_lib)

=head1 AUTHOR

Vladimir Zhavoronkov, <dolbanavt (at) Google Mail>

http://dolbanavt.livejournal.com/

=head1 LICENSE AND COPYRIGHT

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

=cut
